<%@ page import="java.util.Random" %><%--
  Created by IntelliJ IDEA.
  User: huany
  Date: 2018/6/28
  Time: 21:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    if (session.getAttribute("xx")==null){
        session.setAttribute("xx",new Random().nextInt(10));
    }
    System.out.println(session.getAttribute("xx"));
    out.println(session.getAttribute("xx"));
%>

</body>
</html>
